package com.qiaofang.applet.common.util;

/**
 * @author QF2019
 */
public class RedisKeyUtil {

    /**
     * 小程序redis key统一前缀
     */
    private final static String COMMON_PRIX = "applet_";

    /**
     * 获取存储小程序登陆token的Key
     * @param token
     * @return
     */
    public static String getWebTokenKey(String token){
        return COMMON_PRIX + "token_" + token;
    }

    /**
     * 获取存储小程序AccessTokenKey
     * @param appId
     * @return
     */
    public static String getAccessTokenKey(String appId){
        return COMMON_PRIX + "accessToken_" + appId;
    }

    /**
     * 获取存储PC端官网登陆token的Key
     * @param token
     * @return
     */
    public static String getPcWebTokenKey(String token){
        return COMMON_PRIX + "pcToken_" + token;
    }

    /**
     * 获取存储验证码的RedisKey
     * @param mobilePhone
     * @return
     */
    public static String getCaptchaKey(String mobilePhone){
        return COMMON_PRIX + "captcha_" + mobilePhone;
    }

    /**
     * 获取初始化筛选列表的redisKey
     * @param corporationCode
     * @return
     */
    public static String getDictCacheKey(String corporationCode) {
        return COMMON_PRIX + "dictCache_" + corporationCode;
    }

//    /**
//     * 获取城市列表的redisKey
//     * @param corporationCode
//     * @return
//     */
//    public static String getCityListKey(String corporationCode) {
//        return COMMON_PRIX + "cityList_" + corporationCode;
//    }

    /**
     * 获取新房城市列表的redisKey
     * @param corporationCode
     * @return
     */
    public static String getFirstHandCityListKey(String corporationCode) {
        return COMMON_PRIX + "firstHandCityList_" + corporationCode;
    }

    public static String getFirstHandAreaListKey(String cityCode) {
        return COMMON_PRIX + "firstHandAreaList_" + cityCode;
    }

    /**
     * 获取集团下部门映射的redisKey
     * @param corporationCode
     * @return
     */
    public static String getDeptMapKey(String corporationCode, String companyUuid) {
        return COMMON_PRIX + "deptMap_" + corporationCode + "_" + companyUuid;
    }

    /**
     * 获取会员手机号的redisKey
     * @param memberId
     * @return
     */
    public static String getMemberPhoneKey(String memberId) {
        return COMMON_PRIX + "memberPhone_" + memberId;
    }

    /**
     * 获取集团下部门映射的redisKey
     * @param corporationCode
     * @return
     */
    public static String getDistrictAndAreaKey(String corporationCode, String cityCode) {
        return COMMON_PRIX + "districtAndArea_" + corporationCode + "_" + cityCode;
    }

    /**
     * 获取集团下全部区域的redisKey
     * @param corporationCode
     * @return
     */
    public static String getDistrictMapKey(String corporationCode) {
        return COMMON_PRIX + "districtMap_" + corporationCode;
    }

    /**
     * 获取集团下全部商圈的redisKey
     * @param corporationCode
     * @return
     */
    public static String getAreaMapKey(String corporationCode) {
        return COMMON_PRIX + "areaMap_" + corporationCode;
    }

    /**
     * 获取图片验证码的redisKey
     * @param uuid
     * @return
     */
    public static String getPicCaptchaKey(String uuid) {
        return COMMON_PRIX + "picCaptcha_" + uuid;
    }

    /**
     * 获取网易云信用户的redisKey
     * @param accid
     * @return
     */
    public static String getYxUserKey(String accid) {
        return COMMON_PRIX + "yxUser_" + accid;
    }

    /**
     * 获取存储小程序SessionKey的Key
     * @param sessionKey
     * @return
     */
    public static String getWxaSessionKey(String sessionKey){
        return COMMON_PRIX + "sessionKey_" + sessionKey;
    }

    /**
     * 获取存储后台管理系统taskKey的Key
     * @param taskKey
     * @return
     */
    public static String getTaskKey(String taskKey){
        return COMMON_PRIX + "taskKey_" + taskKey;
    }

    /**
     * 获取房源经纪人列表的Key
     * @param companyUuid
     * @return
     */
    public static String getPropertyEmpOrderKey(String companyUuid) {
        return COMMON_PRIX + "propertyEmpOrderKey_" + companyUuid;
    }

    /**
     * 获取当天经纪人会员一对一聊天记录key
     * @param employeeUniqueUuid
     * @param memberId
     * @return
     */
    public static String getMemberChatKey(String employeeUniqueUuid, String memberId){
        return COMMON_PRIX + "memberChatKey_" + employeeUniqueUuid + "_" + memberId;
    }

    /**
     * 获取当天经纪人会员一对一聊天记录key 15分钟后删除 重新记录
     * @param employeeUniqueUuid
     * @param memberId
     * @return
     */
    public static String getEmployeeMemberChatKey(String employeeUniqueUuid, String memberId){
        return COMMON_PRIX + "employeeMemberChatKey_" + employeeUniqueUuid + "_" + memberId;
    }

    /**
     * 获取缓存主域名和集团CODE映射关系的KEY
     * @return
     */
    public static String getWebDomainKey() {
        return COMMON_PRIX + "webdomin";
    }

    /**
     * 获取城市列表的redisKey
     * @return
     */
    public static String getCitysKey() {
        return COMMON_PRIX + "cityList";
    }

    /**
     * 获取城市名称和cityCode的KEY
     * @return
     */
    public static String getCityNameAndCodeListKey() {
        return COMMON_PRIX + "cityNameAndCodeList";
    }

    /**
     * 获取房源详情图片水印的key
     * @param companyUuid
     * @return
     */
    public static String getPropertyWaterMarkKey(String companyUuid) {
        return COMMON_PRIX + "_WaterMark_" + companyUuid;
    }

    /**
     * 获取微信公众号授权的key
     * @param corporationCode
     * @return
     */
    public static String getWxAccessTokenKey(String corporationCode) {
        return COMMON_PRIX + "_AccessToken_" + corporationCode;
    }
}
